package com.kai.steering.data.service.entity.vo;

import cn.hutool.core.bean.BeanUtil;
import com.kai.steering.data.service.entity.domainObject.AnswerDO;
import com.kai.steering.data.service.entity.domainObject.WarehouseDO;
import com.kai.steering.data.service.entity.dto.WarehouseQueryDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import java.io.Serializable;
import java.util.Date;

/**
 * <pre>
 * 答案 VO对象
 * </pre>
 *
 * @author kai
 * @date 2022-02-23
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@ToString
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "AnswerVO对象", description = "答案业务视图")
public class AnswerVO implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "答案id")
    private String answerId;
    @ApiModelProperty(value = "题目id")
    private String questionId;
    @ApiModelProperty(value = "答案")
    private String answer;
    @ApiModelProperty(value = "内容")
    private String content;
    @ApiModelProperty(value = "创建时间")
    private Date creationDatetime;
    @ApiModelProperty(value = "创建人管理员id或者用户id")
    private String founder;
    @ApiModelProperty(value = "回答正确与否 0 正确 1错误")
    private int correct;

    public AnswerVO(AnswerDO answerDO) {
        this.convertAnswerVO(answerDO);
    }

    public AnswerVO convertAnswerVO (AnswerDO answerDO){
        BeanUtil.copyProperties(answerDO,this);
        return this;
    }
}